//
//  HFPreferencesController.m
//  HocusFocus
//
//  Created by Juan Carlos Jimenez on 4/6/08.
//  Copyright 2008 Juan Carlos Jimenez. All rights reserved.
//
#import "HFPreferencesController.h"
#import "HFHotKeyController.h"

NSString *HFPreferencesControllerHotkeyHasChanged = @"HFPreferencesControllerHotkeyHasChanged";

@implementation HFPreferencesController

+ (void)initialize{
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
	NSMutableDictionary *appDefaults = [NSMutableDictionary dictionary];
	
    [appDefaults addEntriesFromDictionary:[HFHotKeyController defaultsDict]];
    
    [defaults registerDefaults:appDefaults];
}

- (id) init
{
	self = [super initWithWindowNibName:@"HFPreferences"];
	if (self != nil) {
		hotkeyController = [[HFHotKeyController alloc] init];
		[hotkeyController registerHotKey:self];
	}
	return self;
}

- (void) dealloc
{
	[hotkeyController release];
	[super dealloc];
}


- (void)takePreferenceChangeFrom:(id)sender
{
	[hotkeyController updateHotKey:self];
}

@end
